#pragma once
#include <string>
#include <vector>

class string_util
{
public:
    static int split(const std::string &in,const std::string &sep,
    std::vector<std::string> &arry)
    {
        arry.clear();
        size_t pos, index = 0;
        while(index < in.size())
        {
            pos = in.find(sep, index);
            if(pos == std::string::npos)
            {
                arry.push_back(in.substr(index));
                break;
            }
            if(pos != index)
            {
                arry.push_back(in.substr(index, pos - index));
            }
            index = pos + sep.size();
        }
        return arry.size();
    }
};
